package com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.maintenancesystem.basisinfo;
import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseService;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.utils.requestutil.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 直属客户服务层
 */
@Service
@Slf4j
public class CustomerService extends BaseService {
    /**
     * @Author YangYu
     * @Description 直属客户分页列表
     * @Date Created in 14:16 2020/12/22
     * @Param [jsonParam]
     */

    public RespEntity customerPageList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","customerPageList","customer");

    }

    /**
     * @Author YangYu
     * @Description 直属客户新增
     * @Date Created in 11:21 2020/12/28
     * @Param []
     */

    public RespEntity add(JSONObject jsonParam){
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","add","customer");
    }

    /**
     * @Author YangYu
     * @Description 直属客户更新
     * @Date Created in 11:22 2020/12/28
     * @Param [jsonParam]
     */

    public RespEntity update(JSONObject jsonParam){
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","update","customer");
    }

    /**
     * @Author YangYu
     * @Description 直属客户详情
     * @Date Created in 11:27 2020/12/28
     * @Param [jsonParam]
     */

    public RespEntity detail(JSONObject jsonParam){
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","detail","customer");
    }
    /**
     * @Author YangYu
     * @Description 直属客户删除
     * @Date Created in 11:27 2020/12/28
     * @Param [jsonParam]
     */

    public RespEntity delete(JSONObject jsonParam){
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","delete","customer");
    }
}
